/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package segundaronda;

import java.util.Scanner;

/**
 *
 * @author juanra
 */
public class VectorDeSueldos {

    private Scanner teclado;
    private int[] vector;
    private String[] paises;
    
    public void llenarVectorStrings(int n){
        paises = new String[n];
        teclado = new Scanner(System.in);
        for (int i = 0; i < paises.length; i++) {
            System.out.println("ingrese el pais: ");
            paises[i] = teclado.next();
        }
    }
    
    public void ordenamientoStrings(){
        String aux;
        for (int i = 0; i < paises.length; i++) {
            for (int j = 0; j < paises.length-1; j++) {
                if (paises[j].compareTo(paises[j+1]) > 0) {
                    aux = paises[j];
                    paises[j] = paises[j+1];
                    paises[j+1] = aux;
                }
            }
        }
    }
    
    public void imprimirString(){
        System.out.println("Paises Ordenados");
        for (int i = 0; i < paises.length; i++) {
            System.out.println("pais" + paises[i]);
        }
    }
    
    public void llenarVector(int n){
        teclado = new Scanner(System.in);
        vector = new int[n];
        for (int i = 0; i < vector.length; i++) {
            System.out.print("digite un numero: ");
            vector[i] = teclado.nextInt();
        }
    }
    
    public void ordenamiento(){
        int aux;
        for (int i = 0; i < vector.length; i++) {
            for (int j = 0; j < vector.length-1; j++) {
                if (vector[j]>vector[j+1]) {
                    aux = vector[j];
                    vector[j] = vector[j+1];
                    vector[j+1] = aux;
                }
            }
        }
    }
    
    public void mayoresEdad(String[] nom, int[] ed){
        for (int i = 0; i < nom.length; i++) {
            if (ed[i] >= 18) {
                System.out.println("es mayor de edad: " + nom[i]);
            }
        }
    }
    
    
    
    public void imprimir(){
        for (int i = 0; i < vector.length; i++) {
            System.out.println("altura " + vector[i]);
        }
    }
    
    public float CalcularPromedio(float[] alturas){
        float p;
        float suma = 0;
        for (int i = 0; i < alturas.length; i++) {
            suma = suma + alturas[i] ;
        }
        p = suma/alturas.length;
        return p;
    }
    
    public float[] altasBajas(float p, float[] altura){
        int altas=0, bajas=0;
        for (int i = 0; i < altura.length; i++) {
            if (p>altura[i]) {
                altas++;
            } else {
                bajas++;
            }
        }
        System.out.println("el promedio es: " + p);
        System.out.println("mas altos qu el promedio: " + altas);
        System.out.println("mas bajos qu el promedio: " + bajas);
        
        return altura;
    }
    
    
    
}
